<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="icon" type="image/ico" th:href="@{/images/favicon.ico}">
    <link rel="stylesheet" type="text/css" th:href="@{/layui/css/layui.css}">
    <link rel="stylesheet" type="text/css" th:href="@{/css/index.css}">
</head>
<body class="layui-tab-content">
<div class="layui-card layui-card-body ">
    <div class="layui-form toolbar"  id="queryTools">
        <div class="layui-form-item">
            <label class="layui-form-label">用户名称:</label>
            <div class="layui-input-inline">
                <input type="text" class="layui-input" id="userName" placeholder="请输入名称">
            </div>
            <label class="layui-form-label">手机号:</label>
            <div class="layui-input-inline">
                <input type="text" class="layui-input" id="tel" placeholder="请输入手机号">
            </div>
            <label class="layui-form-label">所属角色:</label>
            <div class="layui-input-inline">
                <select id="roleId" >
                    <option value="">请选择</option>
                </select>
            </div>
            <label class="layui-form-label">状态:</label>
            <div class="layui-input-inline">
                <select id="status">
                    <option value="">请选择</option>
                    <option value="1">启用</option>
                    <option value="2">禁用</option>
                </select>
            </div>

        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">创建时间:</label>
            <div class="layui-input-inline">
                <input type="text" lay-verify="date" class="layui-input" id="startDate" placeholder="请选择开始时间">
            </div>
            <div class="layui-input-inline">
                <input type="text" lay-verify="date" class="layui-input" id="endDate" placeholder="请选择结束时间">
            </div>
            <button class="layui-btn" id="renderTable">查询</button>
            <button class="layui-btn" id="resetSearch">重置</button>
            <button class="layui-btn" id="addNew">新增</button>
        </div>
    </div>
    <table class="layui-hide" id="userTable" lay-filter="userFilter"></table>
</div>

<!--新增修改用户界面-->
<form class="layui-form " id="userForm" lay-filter="userForm" style="display:none;padding-top:10px">
    <input type="hidden" name="userId">
    <div class="layui-form-item">
        <label class="layui-form-label">用户名称</label>
        <div class="layui-input-block" style="width: 60%;">
            <input type="text" name="userName" lay-verify="required|charName" autocomplete="off" placeholder="请输入用户名称"
                   class="layui-input layui-form-danger">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">手机号</label>
        <div class="layui-input-block" style="width: 60%;">
            <input type="tel" name="userPhone" lay-verify="required|phone|gnTel" autocomplete="off" placeholder="请填写手机号"
                   class="layui-input">
        </div>
    </div>
    <div class="layui-form-item" id="passDiv">
        <label class="layui-form-label">登录密码</label>
        <div class="layui-input-inline">
            <input type="hidden" name="oldPass" value="">
            <input type="password" name="password" autocomplete="off" placeholder="请填写登录密码"
                   class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"><i class="layui-tip-required"></i>所属角色</label>
        <div class="layui-input-block" id="userRoleList">

        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline" style="margin-left: 30px;">
            <lable style="font-size:4px;color: #ff0000;">温馨提示:用户名不允许修改，新用户的初始密码为 88888888</lable>
        </div>
    </div>
    <div class="layui-form-item layui-hide">
        <button id="saveUser" class="layui-btn" lay-submit lay-filter="editUser">保存</button>
    </div>
</form>
<!--列操作-->
<script type="text/html" id="barDemo">
    {{# if(d.userName == 'admin'){ }}
        不可操作
    {{# } else { }}
        <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="edit">修改</a>
        <!--<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="detail">分配角色</a>-->
        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
        {{# if(d.status == 1){ }}
        <a class="layui-btn layui-btn-xs layui-btn-warm" lay-event="disable">禁用</a>
        {{# } else { }}
        <a class="layui-btn layui-btn-xs layui-btn-normal" lay-event="enable">启用</a>
        {{# } }}
    {{# } }}
</script>
<!--<script type="text/html" id="tableToolbar">
    <div class="layui-btn-container">
        <button class="layui-btn layui-btn-warm" lay-event="disable">禁用</button>
        <button class="layui-btn layui-btn-normal" lay-event="enable">启用</button>
        <button class="layui-btn" lay-event="addNew">添加用户</button>
    </div>
</script>-->
<script type="text/javascript" th:src="@{/js/plugins/jquery-1.11.3.min.js}"></script>
<script type="text/javascript" th:src="@{/layui/layui.js}"></script>
<script type="text/javascript" th:src="@{/js/sys/userManage/list.js}"></script>

</body>

</html>